home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
MATHS
/
ARCAUT
/
Automatons
/
Critter
< prev
next >
Wrap
Text File
|
1991-07-30
|
955b
|
41 lines
AUTOMATON*
Critter
A two state automaton in which most cells reverse their state with each
generations (this can lead to a painful flashing display, hence the subdued
colours). From a random blob of mixed states on a plain background, strange
four cell 'critters' mysteriously appear, wander across the display, & then
fall back into the oblivion from which they came. This uses the margolus
neighbourhood. Try 253x14 & other small windows.
INITIALISATION*
10DEF PROCdo
20*SetEval wrap on
30*SetEval neig margolus
40*SetEval i 10
50ENDPROC
SCREEN*
10DEF PROCdo
20DIM buf% 256:SYS "OS_ReadVarVal","i",buf%,256
30c%=FNacol(!buf%)
40GCOL c%AND63 TINT c%
50FOR Q%=1 TO 200
60POINT RND(80)-40,RND(80)-40
70NEXT
80ENDPROC
CODE*
( READ_NEIG
<i> SCOUNT_ALL
DUP 0 = IF (CELL <i> EOR ==)
DUP 1 = IF (CELL <i> EOR ==)
DUP 2 = IF (CELL ==)
3 = IF (OPP <i> EOR ==)
CELL <i> EOR == )
END*